
__author__ = 'lukasz'
import datetime
from django.db import models
from django.contrib.auth.models import User
from cms.models import CMSPlugin
from katedra.employ.models import employ_class

class Publication(models.Model):
    Opis = models.CharField(max_length=100)
    Data = models.DateField(default=datetime.date.today())

    def __unicode__(self):
        return self.Opis


class Author(models.Model):
    author = models.ForeignKey(employ_class)
    publication = models.ForeignKey(Publication)

    def get_absolute_url(self):
        print 'aha'
        return reverse('publications_view', args=[self.pk])




class PublicationPlugin(CMSPlugin):
    author = models.ForeignKey(Publication)

